const { defineConfig } = require('@vue/cli-service');
const webpack = require('webpack');

module.exports = defineConfig({
    transpileDependencies: true,
    outputDir: 'dist',
    assetsDir: 'assets',
    indexPath: 'index.html',
    lintOnSave: false,
    pages: {
        index: {
            entry: 'src/main.js',
            filename: 'index.html',
            title: '后台管理系统'
        }
    },
    productionSourceMap: false,
    devServer: {
        host: '0.0.0.0',
        // port: 8080,
        proxy: {
            '/admin': {
                // target: '',
                target: 'http://www.ts.com',
                // target: 'http://192.168.31.19:8082',
                // target: 'http://175.178.253.101',
                secure: false,
                changeOrigin: true,
                pathRewrite: {
                    // '^/api': ''
                }
            },
        }
    },
    chainWebpack: config => {
        config.plugin('provide').use(webpack.ProvidePlugin, [{
            $: 'jquery',
            jquery: 'jquery',
            jQuery: 'jquery',
            'window.jQuery': 'jquery'
        }])
    }
});
